#ifndef MYWIFI
#define MYWIFI

#include <Arduino.h>
#include <WiFi.h>
#include <WebServer.h> //网络失败配网
#include <DNSServer.h> //网络失败配网
#include <Preferences.h> //持久化存储

#include "OledModule/Oled.h"
#include "MqttModule/MyMqtt.h"

extern const char *ssid;
extern const char *password;


// 设置屏幕间隔时间
extern const unsigned long interval;
extern unsigned long previousMillis; // 上次更新时间

// 声明 WiFiClient 对象
extern WiFiClient espClient;

extern Preferences preferences;

extern WebServer server;
extern DNSServer dnsServer; 

extern String macAddress;

extern IPAddress wifiIp;//存储设备ip地址

bool setupWifi(const char* ssid, const char* password);

void setupAP();

void reflushShowWifiInfo();

void reloadRssi();

void handleNotFound();

void handlerSubmit();

void handerIndex();

#endif